/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};
  // config.cluster = {
  //   listen: {
  //     port: 7003,
  //     hostname: '127.0.0.1', // 不建议设置 hostname 为 '0.0.0.0'，它将允许来自外部网络和来源的连接，请在知晓风险的情况下使用
  //     // path: '/var/run/egg.sock',
  //   },
  // };
  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1580127158788_2148';

  // 今日头条顶部tabs接口地址
  config.todaysUrl = 'https://api3-normal-c-lf.snssdk.com/';

  // 京东万象 api
  config.appKey = '1946619d80cebaeaaeb4074ee549782e';
  config.jdUrl = 'https://way.jd.com/';
  // add your middleware config here
  config.middleware = [];
  config.security = {
    crsf: {
      enable: false,
    },
    domainWhiteList: ['*'],
  };
  config.cors = {
    origin: '*',
    allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS',
  };
  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  return {
    ...config,
    ...userConfig,
  };
};
